home *** CD-ROM | disk | FTP | other *** search
/ ShareWare OnLine 2 / ShareWare OnLine Volume 2 (CMS Software)(1993).iso / os2 / remin301.zip / REMIN300.ZIP / TEST.CMP < prev    next >
Text File  |  1992-11-10  |  13KB  |  505 lines

  1. # Test file for REMIND
  2. #
  3. # Use this file to test the date calculation routines
  4. # of the REMIND program by typing:
  5. #
  6. #     ./test-rem  # From WITHIN Remind source directory!
  7.  
  8. # Test each possible case of the basic reminders.
  9.  
  10. REM MSG Every Day
  11. ./test.rem(10): Trig = Saturday, 16 February, 1991
  12. Reminders for Saturday, 16th February, 1991:
  13.  
  14. Every Day
  15.  
  16.  
  17. REM 18 MSG Every 18th 
  18. ./test.rem(12): Trig = Monday, 18 February, 1991
  19. REM 15 MSG Every 15th
  20. ./test.rem(13): Trig = Friday, 15 March, 1991
  21.  
  22. REM Feb MSG February
  23. ./test.rem(15): Trig = Saturday, 16 February, 1991
  24. February
  25.  
  26. REM Jan MSG January
  27. ./test.rem(16): Trig = Wednesday, 1 January, 1992
  28. REM March MSG March
  29. ./test.rem(17): Trig = Friday, 1 March, 1991
  30.  
  31. REM 13 Jan MSG 13 Jan
  32. ./test.rem(19): Trig = Monday, 13 January, 1992
  33. REM 15 Feb MSG 15 Feb
  34. ./test.rem(20): Trig = Saturday, 15 February, 1992
  35. REM 28 Feb MSG 28 Feb
  36. ./test.rem(21): Trig = Thursday, 28 February, 1991
  37. REM 29 Feb MSG 29 Feb
  38. ./test.rem(22): Trig = Saturday, 29 February, 1992
  39. REM 5 Mar MSG 5 Mar
  40. ./test.rem(23): Trig = Tuesday, 5 March, 1991
  41.  
  42. REM 1990 MSG 1990
  43. ./test.rem(25): Expired
  44. REM 1991 MSG 1991
  45. ./test.rem(26): Trig = Saturday, 16 February, 1991
  46. 1991
  47.  
  48. REM 1992 MSG 1991
  49. ./test.rem(27): Trig = Wednesday, 1 January, 1992
  50.  
  51. REM 1 1990 MSG 1 1990
  52. ./test.rem(29): Expired
  53. REM 29 1991 MSG 29 1991
  54. ./test.rem(30): Trig = Friday, 29 March, 1991
  55. REM 29 1992 MSG 29 1992
  56. ./test.rem(31): Trig = Wednesday, 29 January, 1992
  57. REM 16 1991 MSG 16 1991
  58. ./test.rem(32): Trig = Saturday, 16 February, 1991
  59. 16 1991
  60.  
  61.  
  62. REM Jan 1990 MSG Jan 1990
  63. ./test.rem(34): Expired
  64. REM Feb 1991 MSG Feb 1991
  65. ./test.rem(35): Trig = Saturday, 16 February, 1991
  66. Feb 1991
  67.  
  68. REM Dec 1991 MSG Dec 1991
  69. ./test.rem(36): Trig = Sunday, 1 December, 1991
  70. REM May 1992 MSG May 1992
  71. ./test.rem(37): Trig = Friday, 1 May, 1992
  72.  
  73. REM 1 Jan 1991 MSG 1 Jan 1991
  74. ./test.rem(39): Expired
  75. REM 16 Feb 1991 MSG 16 Feb 1991
  76. ./test.rem(40): Trig = Saturday, 16 February, 1991
  77. 16 Feb 1991
  78.  
  79. REM 29 Dec 1992 MSG 29 Dec 1992
  80. ./test.rem(41): Trig = Tuesday, 29 December, 1992
  81.  
  82. REM Sun MSG Sun
  83. ./test.rem(43): Trig = Sunday, 17 February, 1991
  84. REM Fri Sat Tue MSG Fri Sat Tue
  85. ./test.rem(44): Trig = Saturday, 16 February, 1991
  86. Fri Sat Tue
  87.  
  88.  
  89. REM Sun 16 MSG Sun 16
  90. ./test.rem(46): Trig = Sunday, 17 February, 1991
  91. REM Mon Tue Wed Thu Fri 1 MSG Mon Tue Wed Thu Fri 1
  92. ./test.rem(47): Trig = Friday, 1 March, 1991
  93.  
  94. REM Sun Feb MSG Sun Feb
  95. ./test.rem(49): Trig = Sunday, 17 February, 1991
  96. REM Mon Tue March MSG Mon Tue March
  97. ./test.rem(50): Trig = Monday, 4 March, 1991
  98.  
  99. REM Sun 16 Feb MSG Sun 16 Feb
  100. ./test.rem(52): Trig = Sunday, 17 February, 1991
  101. REM Mon Tue 10 March MSG Mon Tue 10 March
  102. ./test.rem(53): Trig = Monday, 11 March, 1991
  103.  
  104. REM Sat Sun 1991 MSG Sat Sun 1991
  105. ./test.rem(55): Trig = Saturday, 16 February, 1991
  106. Sat Sun 1991
  107.  
  108. REM Mon Tue 1992 MSG Mon Tue 1992
  109. ./test.rem(56): Trig = Monday, 6 January, 1992
  110.  
  111. REM Sun 16 1991 MSG Sun 16 1991
  112. ./test.rem(58): Trig = Sunday, 17 February, 1991
  113. REM Mon Tue Wed Thu Fri 1 1992 MSG Mon Tue Wed Thu Fri 1 1992
  114. ./test.rem(59): Trig = Wednesday, 1 January, 1992
  115.  
  116. REM Mon Feb 1991 MSG Mon Feb 1991
  117. ./test.rem(61): Trig = Monday, 18 February, 1991
  118. REM Tue Jan 1992 MSG Tue Jan 1992
  119. ./test.rem(62): Trig = Tuesday, 7 January, 1992
  120.  
  121. REM Sun Mon 16 Feb 1991 MSG Sun Mon 16 Feb 1991
  122. ./test.rem(64): Trig = Sunday, 17 February, 1991
  123. REM Tue 28 Jan 1992 MSG Tue 28 Jan 1992
  124. ./test.rem(65): Trig = Tuesday, 28 January, 1992
  125.  
  126. # Try some Backs
  127. CLEAR-OMIT-CONTEXT
  128. REM 1 -1 OMIT sat sun MSG 1 -1 OMIT Sat Sun
  129. ./test.rem(69): Trig = Thursday, 28 February, 1991
  130. REM 1 --1 OMIT sat sun MSG 1 --1 OMIT Sat Sun
  131. ./test.rem(70): Trig = Thursday, 28 February, 1991
  132.  
  133. OMIT 28 Feb
  134. REM 1 -1 OMIT sat sun MSG 1 -1 OMIT Sat Sun (28 Feb omitted)
  135. ./test.rem(73): Trig = Wednesday, 27 February, 1991
  136. REM 1 --1 OMIT sat sun MSG 1 --1 OMIT Sat Sun (28 Feb omitted)
  137. ./test.rem(74): Trig = Thursday, 28 February, 1991
  138.  
  139. CLEAR-OMIT-CONTEXT
  140.  
  141. # Try out UNTIL
  142. REM Wed UNTIL 21 Feb 1991 MSG Wed UNTIL 21 Feb 1991
  143. ./test.rem(79): Trig = Wednesday, 20 February, 1991
  144.  
  145. # Try playing with the OMIT context
  146.  
  147. OMIT 28 Feb 1991
  148. REM 1 Mar -1 MSG 1 mar -1 (28feb91 omitted)
  149. ./test.rem(84): Trig = Wednesday, 27 February, 1991
  150. REM 1 Mar --1 MSG 1 mar --1 (28Feb91 omitted)
  151. ./test.rem(85): Trig = Thursday, 28 February, 1991
  152. REM 28 Feb BEFORE MSG 28 Feb BEFORE (28Feb91 omitted)
  153. ./test.rem(86): Trig = Wednesday, 27 February, 1991
  154. REM 28 Feb SKIP MSG 28 Feb SKIP (28Feb91 omitted)
  155. ./test.rem(87): Trig = Friday, 28 February, 1992
  156. REM 28 Feb AFTER MSG 28 Feb AFTER (28Feb91 omitted)
  157. ./test.rem(88): Trig = Friday, 1 March, 1991
  158.  
  159. PUSH-OMIT-CONTEXT
  160. CLEAR-OMIT-CONTEXT
  161. REM 1 Mar -1 MSG 1 mar -1
  162. ./test.rem(92): Trig = Thursday, 28 February, 1991
  163. REM 1 Mar --1 MSG 1 mar --1
  164. ./test.rem(93): Trig = Thursday, 28 February, 1991
  165. REM 28 Feb BEFORE MSG 28 Feb BEFORE
  166. ./test.rem(94): Trig = Thursday, 28 February, 1991
  167. REM 28 Feb SKIP MSG 28 Feb SKIP 
  168. ./test.rem(95): Trig = Thursday, 28 February, 1991
  169. REM 28 Feb AFTER MSG 28 Feb AFTER
  170. ./test.rem(96): Trig = Thursday, 28 February, 1991
  171.  
  172. POP-OMIT-CONTEXT
  173. REM 1 Mar -1 MSG 1 mar -1 (28feb91 omitted)
  174. ./test.rem(99): Trig = Wednesday, 27 February, 1991
  175. REM 1 Mar --1 MSG 1 mar --1 (28Feb91 omitted)
  176. ./test.rem(100): Trig = Thursday, 28 February, 1991
  177. REM 28 Feb BEFORE MSG 28 Feb BEFORE (28Feb91 omitted)
  178. ./test.rem(101): Trig = Wednesday, 27 February, 1991
  179. REM 28 Feb SKIP MSG 28 Feb SKIP (28Feb91 omitted)
  180. ./test.rem(102): Trig = Friday, 28 February, 1992
  181. REM 28 Feb AFTER MSG 28 Feb AFTER (28Feb91 omitted)
  182. ./test.rem(103): Trig = Friday, 1 March, 1991
  183.  
  184.  
  185. REM 13 March 1991 *1 UNTIL 19 March 1991 MSG 13-19 Mar 91
  186. ./test.rem(106): Trig = Wednesday, 13 March, 1991
  187.  
  188. # Test BACK
  189. CLEAR-OMIT-CONTEXT
  190. REM 18 Feb 1991 +1 MSG 18 Feb 1991 +1
  191. ./test.rem(110): Trig = Monday, 18 February, 1991
  192.  
  193. OMIT 17 Feb 1991
  194. REM 18 Feb 1991 +1 MSG 18 Feb 1991 +1 (17Feb91 omitted)
  195. ./test.rem(113): Trig = Monday, 18 February, 1991
  196. 18 Feb 1991 +1 (17Feb91 omitted)
  197.  
  198. REM 18 Feb 1991 ++1 MSG 18 Feb 1991 ++1 (17Feb91 omitted)
  199. ./test.rem(114): Trig = Monday, 18 February, 1991
  200.  
  201. CLEAR-OMIT-CONTEXT
  202. set a000 abs(1)
  203. abs(1) => 1
  204. set a001 abs(-1)
  205. - 1 => -1
  206. abs(-1) => 1
  207. set a002 asc("foo")
  208. asc("foo") => 102
  209. set a003 baseyr()
  210. baseyr() => 1990
  211. set a004 char(66,55,66,77,66)
  212. char(66, 55, 66, 77, 66) => "B7BMB"
  213. set a005 choose(3, "foo", "bar", "baz", "blech")
  214. choose(3, "foo", "bar", "baz", "blech") => "baz"
  215. set a006 coerce("string", 1)
  216. coerce("string", 1) => "1"
  217. set a007 coerce("string", today())
  218. today() => 1991/02/16
  219. coerce("string", 1991/02/16) => "1991/02/16"
  220. set a008 coerce("string", 11:44)
  221. coerce("string", 11:44) => "11:44"
  222. set a009 coerce("int", "badnews")
  223. coerce("int", "badnews") => Can't coerce
  224. ./test.rem(126): Can't coerce
  225. set a010 coerce("int", "12")
  226. coerce("int", "12") => 12
  227. set a011 coerce("int", 11:44)
  228. coerce("int", 11:44) => 704
  229. set a012 coerce("int", today())
  230. today() => 1991/02/16
  231. coerce("int", 1991/02/16) => 411
  232. set a013 date(1992, 2, 2)
  233. date(1992, 2, 2) => 1992/02/02
  234. set a014 date(1993, 2, 29)
  235. date(1993, 2, 29) => Bad date specification
  236. ./test.rem(131): Bad date specification
  237. set a015 day(today())
  238. today() => 1991/02/16
  239. day(1991/02/16) => 16
  240. set a016 daysinmon(2, 1991)
  241. daysinmon(2, 1991) => 28
  242. set a017 daysinmon(2, 1992)
  243. daysinmon(2, 1992) => 29
  244. set a018 defined("a017")
  245. defined("a017") => 1
  246. set a019 defined("a019")
  247. defined("a019") => 0
  248. set a020 filename()
  249. filename() => "./test.rem"
  250. set a021 getenv("TEST_GETENV")
  251. getenv("TEST_GETENV") => "foo bar baz"
  252. set a022 hour(11:22)
  253. hour(11:22) => 11
  254. set a023 iif(1, 1, 0)
  255. iif(1, 1, 0) => 1
  256. set a024 iif(0, 1, 0)
  257. iif(0, 1, 0) => 0
  258. set a025 index("barfoobar", "foo")
  259. index("barfoobar", "foo") => 4
  260. set a026 index("barfoobar", "bar", 2)
  261. index("barfoobar", "bar", 2) => 7
  262. set a027 isleap(today())
  263. today() => 1991/02/16
  264. isleap(1991/02/16) => 0
  265. set a028 isleap(1992)
  266. isleap(1992) => 1
  267. omit [trigger(today())]
  268. today() => 1991/02/16
  269. trigger(1991/02/16) => "16 February 1991"
  270. set a030 isomitted(today())
  271. today() => 1991/02/16
  272. isomitted(1991/02/16) => 1
  273. clear
  274. set a029 isomitted(today())
  275. today() => 1991/02/16
  276. isomitted(1991/02/16) => 0
  277. set a031 lower("FOOBARBAZ")
  278. lower("FOOBARBAZ") => "foobarbaz"
  279. set a032 max(1, 2, 34, 1, 3)
  280. max(1, 2, 34, 1, 3) => 34
  281. set a033 max("foo", "bar", "baz")
  282. max("foo", "bar", "baz") => "foo"
  283. set a034 max(today(), today()+1, today()-1)
  284. today() => 1991/02/16
  285. today() => 1991/02/16
  286. 1991/02/16 + 1 => 1991/02/17
  287. today() => 1991/02/16
  288. 1991/02/16 - 1 => 1991/02/15
  289. max(1991/02/16, 1991/02/17, 1991/02/15) => 1991/02/17
  290. set a035 min(1, 2, 34, 1, 3)
  291. min(1, 2, 34, 1, 3) => 1
  292. set a036 min("foo", "bar", "baz")
  293. min("foo", "bar", "baz") => "bar"
  294. set a037 min(today(), today()+1, today()-1)
  295. today() => 1991/02/16
  296. today() => 1991/02/16
  297. 1991/02/16 + 1 => 1991/02/17
  298. today() => 1991/02/16
  299. 1991/02/16 - 1 => 1991/02/15
  300. min(1991/02/16, 1991/02/17, 1991/02/15) => 1991/02/15
  301. set a038 minute(11:33)
  302. minute(11:33) => 33
  303. set a039 mon(today())
  304. today() => 1991/02/16
  305. mon(1991/02/16) => "February"
  306. set a040 monnum(today())
  307. today() => 1991/02/16
  308. monnum(1991/02/16) => 2
  309. set a041 ord(3)
  310. ord(3) => "3rd"
  311. set a042 ord(4)
  312. ord(4) => "4th"
  313. set a043 ostype()
  314. ostype() => "UNIX"
  315. set a044 plural(2)
  316. plural(2) => "s"
  317. set a045 plural(2, "ies")
  318. plural(2, "ies") => "iess"
  319. set a046 plural(2, "y", "ies")
  320. plural(2, "y", "ies") => "ies"
  321. set a047 sgn(-2)
  322. - 2 => -2
  323. sgn(-2) => -1
  324. set a048 shell("echo foo")
  325. shell("echo foo") => "foo"
  326. set a049 strlen("sadjflkhsldkfhsdlfjhk")
  327. strlen("sadjflkhsldkfhsdlfjhk") => 21
  328. set a050 substr(a049, 2)
  329. a049 => 21
  330. substr(21, 2) => Type mismatch
  331. ./test.rem(169): Type mismatch
  332. set a051 substr(a050, 2, 6)
  333. a050 => ./test.rem(170): Undefined variable: a050
  334. set a052 time(1+2, 3+4)
  335. 1 + 2 => 3
  336. 3 + 4 => 7
  337. time(3, 7) => 03:07
  338. rem 10 jan 1992 AT 11:22 CAL
  339. ./test.rem(172): Trig = Friday, 10 January, 1992
  340. set a053 trigdate()
  341. trigdate() => 1992/01/10
  342. set a054 trigtime()
  343. trigtime() => 11:22
  344. set a055 trigvalid()
  345. trigvalid() => 1
  346. set a056 upper("sdfjhsdf ksjdfh kjsdfh ksjdfh")
  347. upper("sdfjhsdf ksjdfh kjsdfh ksjdfh") => "SDFJHSDF KSJDFH KJSDFH KSJDFH"
  348. set a057 value("a05"+"6")
  349. "a05" + "6" => "a056"
  350. value("a056") => "SDFJHSDF KSJDFH KJSDFH KSJDFH"
  351. set a058 version()
  352. version() => "03.00.00"
  353. set a059 wkday(today())
  354. today() => 1991/02/16
  355. wkday(1991/02/16) => "Saturday"
  356. set a060 wkdaynum(today())
  357. today() => 1991/02/16
  358. wkdaynum(1991/02/16) => 6
  359. set a061 year(today())
  360. today() => 1991/02/16
  361. year(1991/02/16) => 1991
  362. set a062 1+2*(3+4-(5*7/2))
  363. 3 + 4 => 7
  364. 5 * 7 => 35
  365. 35 / 2 => 17
  366. 7 - 17 => -10
  367. 2 * -10 => -20
  368. 1 + -20 => -19
  369. set a063 1>=2
  370. 1 >= 2 => 0
  371. set a064 1<2 || 3 > 4
  372. 1 < 2 => 1
  373. 3 > 4 => 0
  374. 1 || 0 => 1
  375. set a065 1 && 1
  376. 1 && 1 => 1
  377. set a066 !a065
  378. a065 => 1
  379. ! 1 => 0
  380. set a067 typeof(2)
  381. typeof(2) => "INT"
  382. set a068 typeof("foo")
  383. typeof("foo") => "STRING"
  384. set a069 typeof(11:33)
  385. typeof(11:33) => "TIME"
  386. set a070 typeof(today())
  387. today() => 1991/02/16
  388. typeof(1991/02/16) => "DATE"
  389. fset g(x,y) max(x,y)
  390. fset h(x,y) min(g(x+y, x*y), g(x-y, x/y))
  391. set a071 g(1, 2)
  392. UserFN g(1, 2)
  393. x => 1
  394. y => 2
  395. max(1, 2) => 2
  396. Leaving UserFN g() => 2
  397. set a072 h(2, 3)
  398. UserFN h(2, 3)
  399. x => 2
  400. y => 3
  401. 2 + 3 => 5
  402. x => 2
  403. y => 3
  404. 2 * 3 => 6
  405. UserFN g(5, 6)
  406. x => 5
  407. y => 6
  408. max(5, 6) => 6
  409. Leaving UserFN g() => 6
  410. x => 2
  411. y => 3
  412. 2 - 3 => -1
  413. x => 2
  414. y => 3
  415. 2 / 3 => 0
  416. UserFN g(-1, 0)
  417. x => -1
  418. y => 0
  419. max(-1, 0) => 0
  420. Leaving UserFN g() => 0
  421. min(6, 0) => 0
  422. Leaving UserFN h() => 0
  423. set a073 h("foo", 11:33)
  424. UserFN h("foo", 11:33)
  425. x => "foo"
  426. y => 11:33
  427. "foo" + 11:33 => "foo11:33"
  428. x => "foo"
  429. y => 11:33
  430. "foo" * 11:33 => Type mismatch
  431. ./test.rem(195): Operator '*' Type mismatch
  432. Leaving UserFN h() => Type mismatch
  433.  
  434.     Variable  Value
  435.  
  436.         a017  29
  437.         a036  "bar"
  438.         a055  1
  439.         a008  "11:44"
  440.         a027  0
  441.         a046  "ies"
  442.         a065  1
  443.         a018  1
  444.         a037  1991/02/15
  445.         a056  "SDFJHSDF KSJDFH KJSDFH KSJDFH"
  446.         a028  1
  447.         a047  -1
  448.         a066  0
  449.         a019  0
  450.         a038  33
  451.         a057  "SDFJHSDF KSJDFH KJSDFH KSJDFH"
  452.         a029  0
  453.         a048  "foo"
  454.         a067  "INT"
  455.         a039  "February"
  456.         a058  "03.00.00"
  457.         a049  21
  458.         a068  "STRING"
  459.         a059  "Saturday"
  460.         a069  "TIME"
  461.         a000  1
  462.         a010  12
  463.         a001  1
  464.         a020  "./test.rem"
  465.         a011  704
  466.         a030  1
  467.         a002  102
  468.         a021  "foo bar baz"
  469.         a040  2
  470.         a012  411
  471.         a031  "foobarbaz"
  472.         a003  1990
  473.         a022  11
  474.         a041  "3rd"
  475.         a060  6
  476.         a013  1992/02/02
  477.         a032  34
  478.         a070  "DATE"
  479.         a004  "B7BMB"
  480.         a023  1
  481.         a042  "4th"
  482.         a061  1991
  483.         a033  "foo"
  484.         a052  03:07
  485.         a071  2
  486.         a005  "baz"
  487.         a024  0
  488.         a043  "UNIX"
  489.         a062  -19
  490.         a015  16
  491.         a034  1991/02/17
  492.         a053  1992/01/10
  493.         a072  0
  494.         a006  "1"
  495.         a025  4
  496.         a044  "s"
  497.         a063  0
  498.         a016  28
  499.         a035  1
  500.         a054  11:22
  501.         a007  "1991/02/16"
  502.         a026  7
  503.         a045  "iess"
  504.         a064  1
  505.